Skip to content

Don't allow equal query and schema paths #179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Don't allow equal query and schema paths #179

wants to merge 1 commit into from

Conversation

dominikbraun
Copy link
Contributor

At the moment (without PR #178), this config file causes sqlc to panic:

{
  "version": "1",
  "packages": [
    {
      "name": "db",
      "emit_json_tags": true,
      "emit_prepared_queries": false,
      "path": "db",
      "queries": "db.sql",
      "schema": "db.sql"
    }
  ]
}

sqlc can't handle the situation where the queries value is equal to the schema value.

While #178 fixes the panic from a technical point of view and prevents sqlc from panicking in other situations, this PR checks if the paths are the same and informs the user if necessary.

@kyleconroy
Copy link
Collaborator

See #180 for an alternative to this change

@dominikbraun
Copy link
Contributor Author

dominikbraun commented Dec 16, 2019

I'd prefer #180 since it allows the same path/file.

@kyleconroy
Copy link
Collaborator

Great, closing this in favor of merging #180

@kyleconroy kyleconroy closed this Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants